package com.ai.ly.goodsautocat.autocat;

import de.bwaldvogel.liblinear.Feature;
import de.bwaldvogel.liblinear.Linear;
import de.bwaldvogel.liblinear.Model;

public class AutoCatPredictor {
	
    public static double predictY(Model model,Feature[] features) throws Exception {
    	double prediction = Linear.predict(model, features);
        return prediction;
    }
    
    public static double[] predictY(Model model,Feature[][] arrayOfFeatures) throws Exception {
        double[] result=new double[arrayOfFeatures.length];
        int i=0;
        for (Feature[] features : arrayOfFeatures) {
            double prediction = predictY(model,features);
            result[i]=prediction;
            i++;
        }
        return result;
    }
    
}
